<?php
/**
 * Created by PhpStorm.
 * User: 张秀雨
 * Date: 2019/1/14
 * Time: 9:45
 */

namespace app\index\controller;


class Lagou extends Bank
{

    public function index()
    {

        // 比较懒， 直接复制 页面代码放到文件中， 获取里面的城市了   ^V^^V^^V^^V^
        $myfile = fopen(dirname(__FILE__)."\city.txt", "r") or die("Unable to open file!");
        $cityList = fread($myfile,filesize(dirname(__FILE__)."\city.txt"));
        fclose($myfile);

        $cityList = explode("</td>",$cityList);
        foreach ($cityList as $ke => $va){
            $cityList[$ke]= strip_tags($va) == '&nbsp;' ? '' : strip_tags($va);
        }
        $this->view->citylist = $cityList;

        $this->view->page = $page = input('page',1);
        $this->view->city = $city = input('city','全国');

        list($this->view->totalPages,$this->view->list) = model('Lagou')->getLagouData($city,$page);
        return view();
    }

}